﻿<link href="@Url.Content("~/content/subnav.css")" rel="stylesheet" type="text/css"/>
<link href="@Url.Content("~/content/activitie_detail.css")" rel="stylesheet" type="text/css"/>
<link href="@Url.Content("~/content/table_btn.css")" rel="stylesheet" type="text/css"/>

<!--[if lt IE 8]>
    <link href="@Url.Content("~/content/activitie_create.css")" rel="stylesheet" type="text/css"/>
<![endif]-->

<noscript>
    <link href="@Url.Content("~/content/activitie_create.css")" rel="stylesheet" type="text/css"/>
    <link href="@Url.Content("~/content/activitie_noscript.css")" rel="stylesheet" type="text/css"/>
</noscript>

@model PessMvc.Models.RuleModel

@{
    ViewBag.Title = "Index";
    var subjects = Model.Subjects;
    var paperrules = Model.PaperRules;
}

<h1>Review Rules</h1>
<h2 style="clear:both;width:300px">Proceedings</h2>
<div id="operate">
    @Html.ActionLink("Create New", "Create", "PaperRule", new { activityid = ViewBag.ActivityID },null)
</div>
<div class="displayConScroe">
    <table>
        <tr>
            <th>
                Name
            </th>
            <th>
                Description
            </th>
            <th>
               Score
            </th>
            <th></th>
        </tr>

        @foreach (var item in paperrules)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Value)
                </td>
                <td>
                @if (Roles.IsUserInRole("Admin") || Roles.IsUserInRole("Chair") ||Roles.IsUserInRole("Editor") || (bool)ViewBag.ShowCreateRuleButton)
                {
                        @Html.ActionLink("Edit", "Edit", "PaperRule", new { id = item.ID }, null) 
                        @*@Html.ActionLink("Details", "Details", new { id = item.ID })*@ 
                        @Html.ActionLink("Delete", "Delete", "PaperRule", new { id = item.ID }, null)
                    }
                </td>
            </tr>
        }

    </table>
    </div>

    <h2 style="clear: both; width: 300px">Proposals</h2>
    <div id="operate">
        @*    @Html.ActionLink("New", "Create")*@
    </div>
    <div class="displayConScroe">
        <table>
            <tr>
                <th>
                    @*@Html.DisplayNameFor(model => model.Name)*@Topic
                </th>
                <th>
                    Number of Rules
                </th>
                @*<th>
                        允许组长设定规则
                    </th>*@
                <th></th>
            </tr>

            @foreach (var item in subjects)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Rules.Count)
                    </td>
                    @*<td>
                            @if(item.AllowExpertLeaderSetRules!=null&&item.AllowExpertLeaderSetRules==true)
                            {<span>是</span>}
                            else{<span>否</span>}
                        </td>*@
                    <td>
                        @*@if(Roles.IsUserInRole("Admin"))
                            {
                                @Html.ActionLink("编辑", "Edit","Subject", new { id=item.ID },null)
                            }*@
                        @Html.ActionLink("Rules", "Details", new { subjectID = item.ID })
                        @*                @Html.ActionLink("删除", "Delete", new { subjectID=item.ID })*@
                    </td>
                </tr>
            }

        </table>
    </div>
